<?php
namespace app\admin\controller;
use think\Controller;
use think\Db;
class Article extends Controller
{
    public function index_cate()
    {
    	return view();
    }
    public function add_cate()
    {
    	if(request()->IsAjax()){
	    	$shujv = input('post.');
	    	$shujv['create_time'] = time();
	    	$shujv['update_time'] = time();
	    	$result = Db::name('cate')->insert($shujv);
	    	if($result===false){
	    		exit(json_encode(array('status'=>'n','info'=>'数据添加失败!')));
	    	}else{
	    		exit(json_encode(array('status'=>'y','info'=>'数据添加成功!')));
	    	}
    	}
        return view();
    }
}
